﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DatabaseCore
{
    public class OrderDetailHistoryDao : IOrderDetailHistoryDao
    {
        public bool Insert(tbl_OrderDetailHistory entity)
        {
            return Insert(new List<tbl_OrderDetailHistory>() {entity});
        }

        public bool Insert(List<tbl_OrderDetailHistory> entity)
        {
            using (var ctx = new ExportDBEntities())
            {
                foreach (var item in entity)
                {
                    ctx.tbl_OrderDetailHistory.Add(item);
                }
                
                return ctx.SaveChanges() > 0;
            }
        }
    }
}
